﻿@using CML.Intercamber.Business
@using CML.Intercamber.Business.Helper
@model Users
@{
    ViewBag.PageTitle = Resources.Intercamber.Translations_PageName;
}
@section PageHead
{
    
}
@section PageContent
{
    @{
        List<Hobbies> allHobbies = ViewBag.AllHobbies;
    }

    <div style="position: relative">
        <img style="position: absolute; left: 113px; top: 0;" src="~/Images/RoundFlagsSmall/RoundFlag_@(Model.IdCountry).png" />
        <img src="@Url.Content(Model.PhotoDirectory == null || Model.PhotoProfile == null ? "/Images/NoAvatar.png" : "/Images/_upload_/" + Model.PhotoDirectory + "/" + Model.PhotoProfile + ".png")" style="display: inline-block; float: left; margin: 23px 25px 5px 0; width: 140px;" />
    </div>
    <span style="font-weight: bold; margin-top: 15px; display: inline-block;">@Model.FirstName @Model.LastName</span><br />
    @Resources.Intercamber.Gender: @(Model.IdGender == 1 ? Resources.Intercamber.Gender_Boy : Resources.Intercamber.Gender_Girl)<br />
    @Resources.Intercamber.Age: @(Model.BirthDate != null ? DateTimeHelper.Age(Model.BirthDate.Value).ToString() : "?")<br/> 
    @Resources.Intercamber.City: @Model.City<br/>
    @Resources.Intercamber.Profil_NumberContacts: @Model.NumberContacts<br/>
    @Resources.Intercamber.Profil_LearntLanguages: @string.Join(", ", Model.UsersLearnLanguages.Select(x => CML.Intercamber.Web.Helpers.ResourcesHelper.GetString("Languages_" + x.IdLanguage) + (string.IsNullOrEmpty(x.LanguageLevel) ? "" : " (" + x.LanguageLevel + ")")).ToList())<br/>
    @Resources.Intercamber.Profil_NumberPoints: @Model.Score<br/>
    @Resources.Intercamber.Hobbies: 
    <div style="padding-left: 10px">
        @Html.Raw(string.Join("<br/> ", Model.UsersHobbies.Select(x => "- " + CML.Intercamber.Web.Helpers.ResourcesHelper.GetString(allHobbies.FirstOrDefault(h => h.CodeHobby == x.CodeHobby).LblHobby)).ToList()))<br/>
    </div>
    @Resources.Intercamber.Establishment: @Model.Establishments.LblEstablishment - @Model.Establishments.City (@CML.Intercamber.Web.Helpers.ResourcesHelper.GetString("Countries_" + Model.Establishments.IdCountry))<br/>
    @Resources.Intercamber.Profil_CurrentScholarLevel: @Model.ScholarLevel<br/>
    <br/>
    @if (!string.IsNullOrEmpty(Model.PresentationText))
    {
        @Html.Raw(Resources.Intercamber.PresentationText + ": " + HttpUtility.HtmlDecode(Model.PresentationText))
    }
}